package com.xing.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xing.dto.LiveIdentityAuthenticationDTO;
import com.xing.entity.LiveIdentityAuthenticationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface LiveIdentityAuthenticationDao extends BaseMapper<LiveIdentityAuthenticationEntity> {


    @Select("select real_name,\n" +
            "       id_card,\n" +
            "       address,\n" +
            "       sex,\n" +
            "       so1.url as frontal_view,\n" +
            "       so2.url as reverse_view\n" +
            "from live_identity_authentication lia\n" +
            "         left join sys_oss so1 on lia.frontal_view = so1.id\n" +
            "         left join sys_oss so2 on lia.reverse_view = so2.id\n" +
            "where lia.id = #{id}\n" +
            "  and lia.del_flag = 0;")
    LiveIdentityAuthenticationDTO getgetAuthenticationById(Long id);
}
